perm filename CIRCUI[RDG,DBL] blob sn#690307 filedate 1982-12-13 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00014 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	What does it mean to be a circuit?
C00003 00003	Analogy Task
C00004 00004	I need an inventory of things, and what they do.
C00006 00005	Parameters for each device
C00007 00006	Relations
C00009 00007		Stuff taken from SCORE file - circa 18-Nov
C00014 00008		***** Facts re: Circuits *****
C00016 00009	***** Considerations for circuits *****
C00017 00010	Kirchoff's Law
C00020 00011	Defn of Circuit:
C00021 00012	Electrical Circuit
C00022 00013	Facts about circuits
C00029 00014		** General Rules **
C00032 ENDMK
C⊗;
What does it mean to be a circuit?
(1) Devices connected at junctions,
(2) Topology of connections is important --
	in particular, it forms circular loops.
(3) Conservation -
	Net flow thru junctions is zero.

Analogy Task

Take X, which has two theories/models of circuits
 -- e.g. renal system (RS) and analog electronic circuit (EC).

Facts like
RS
  Heart
  Lungs
  ...

EC
  Wire
  Resister
  ...

Had connectivities, but no actual reification of the wires.
This then "learned" from EC
Imagine there was 
I need an inventory of things, and what they do.

Wires - (effectively) no resistance, nor time delay
	[pipe]
Resistors - like wires, but with resistance
	[thin pipe]
Capacitors - store /stuff/ for length of time
	[dam]
Battery - source (and sink) for /stuff/
	[?] ?pump?
Switch - direct flow to one of several ports
	Transistor
	
Filter -

Transistor, Diode, 
Transformer
various "external devices" - horn, electric light, fuse, heater, ...
	[just modelled as resistor, or inductance things?]

what of larger units - wheystone bridge, or 
----

---
Can do explanation using reason-maintanence -- answering why ...
Parameters for each device

*** Static Properties, Internal
	Names of the ports (these are slots for i/o)
	Resistance between each pair of ports
		[this may be directional - for transistors, diodes]
		[it may be time dependent - for switches,]
	Contents (as function of time)
		[may depend on substance]
	Leakage rate

*** Static Properties, External
	Connectivity

*** Dynamic Properties
	current contents
	"switch position" -- e.g. flowing, or ...

whether earlier portals are open or not...

For each port, I need /stuff/ enterring that port (and thence to device)
AC vs DC

Relations

(Relevant-Relns Pipes ?)

(Mem Pipe2 Pipes)
(Width Pipe2 1.7)
(Length Pipe2 4.3)
;; Linear or Bent?
;; Circular orifice, or ?
;; Unidirectional or Bidirectional
;; --- & are these features constant (static), or time dependent?

(FlowRate Pipe2 12.3)  ; is this a function of substance

Dynamic:
(Contents Pipe2 3.2gallons)

	Names of the ports (these are slots for i/o)
	Resistance between each pair of ports
		[this may be directional - for transistors, diodes]
		[it may be time dependent - for switches,]
	Contents (as function of time)
		[may depend on substance]
	Leakage rate

For each port, I need /stuff/ enterring that port (and thence to device)
AC vs DC
	Stuff taken from SCORE file - circa 18-Nov

This file holds facts about electrical circuits.

------
<1> ***** Facts about Graphs *****
Each (directed) graph is a collection of nodes and links.
Each links leads from a node to another (not necessarily distinct) node.
Associated with each link is a value (usually called cost).
	(We may discuss a vector of values.)

--------
<2> ***** Facts about Circuits *****
(* Each LINK leads from somewhere to somewhere, 
	and transports some substance along that path.
  Below we specify the static properties.)

Each circuit is a DIRECTED graph,
 whose nodes are called nodes, and whose links are called links
	(later, junctions and conduits).
Each link has a bunch of values.

(ALL $L
(IF (MEMB $L LINKS)
   (AND (FROM $L ?FROM) 
	(TO $L ?TO)
	(SUBSTANCES $L ?*STUFFES)
	(CAPACITY $L ?CAP)
	(RESISTANCE $L ?RESIST)
	(VALUE $L ?what-goes-here?)
))
)

(DOMAIN FROM 1 LINKS)
(DOMAIN FROM 2 NODES)
(DOMAIN TO 1 LINKS)
(DOMAIN TO 2 NODES)
(DOMAIN CAPACITY 1 LINKS)
(DOMAIN CAPACITY 2 INTEGERS)
(DOMAIN RESISTANCE 1 LINKS)
(DOMAIN RESISTANCE 2 INTEGERS)
(DOMAIN VALUE 1 LINKS)
(DOMAIN VALUE 2 INTEGERS)

------
<3> ***** Facts about Electrical Circuits *****

(SUBSET RESISTERS LINKS)
(IF (RESISTER $R) (NON-TRIVIAL (RESISTANCE $R) ))

(SUBSET WIRES LINKS)
(IF (WIRES $W) (TRIVIAL (RESISTANCE $W) ))

...
still need 
BATTERIES
CAPACITORS
DIODES
TRANSISTORS
SWITCHES
...

***** Facts about ?Explanation? diagnostics *****
	Static Information
Here we have a collection of junctions, JUNCTIONS = {J-i}, and a collection
of "things", THINGS = {T-j}; and a pair of interconnecting relations,

	From( T-j, J-i  )
	To(   T-j, J-i' ),

meaning that the link T-j goes from J-i to J-i'.  We also have

	C( T-j ) = V,

meaning that the capacity of this link is V. (V will always be non-negative --
thereby defining direction...)
(Later may need to discuss capacity, in a link, of some fluid.)

These links may have other properties as well -- e.g. retention (consider
	battery or capacitor) or resistance...

	Dynamic Information
(This is temporal information)

	Contents( J-i,t ) = amount of stuff in node J-i at time t
	Flow( T-j,t ) = stuff which travelled thru T-j (from J-i to J-i')
			during (at?) time t

Note:
	Flow( T-j,t ) =< C( T-j )  for all time

Clearly
	Contents( J-i, t+1 ) = Contents( J-i,t ) + 

(IF LOW
-------

	***** Facts re: Circuits *****

There are Junctions, Junctions = {N-i}, a set of Devices, Devices = {L-j},
and a pair of connecting relations,

	From(L-j, N-i) 
	To(L-j, N-i'),

meaning that L-j connects from N-i, and to N-i', respectively.
In addition, each link has a capacity -
	C(L-j) = V,
which means that V amount can flow through this link
(i.e. between the Junctions N-i and N-i').

For convenience, we can define
   Adjacent(N-i, N-j)	<=>  
	∃ l ε Devices. [From(l N-i) & To(l N-j)] OR
		    [From(l N-j) & To(l N-i)]

   DirFlow(N-i, N-j, V)	<=>  ∃ l ε Devices. [(From l N-i) & (To l N-j) & C(l V)]

and from this,
		   /  V	if DirFlow(N-i, N-j, V)
  Flow(N-i, N-j) =   -V	if DirFlow(N-j, N-i, V)
		   \  0	otherwise.

***** Considerations for circuits *****

Graphs (in general)
	Connections
	uni-directional vs bi-directional

Directed Graphs

Weighted Graphs
	different resistances
	different materials -- so C takes another argument;

Cyclc Graphs (circuits)
	Feedback, blockage, extra connections (short)

Real world
	Quantized time
	Unexpected connections - leakage
	? interference 

Kirchoff's Law
	EveryDevice which enters a node, leaves it.

∀ n ε Junctions. Apply["Sum", x ε Junctions, Flow(n , x) ] = 0

(We really could replace the second "Junctions" with Adjacent(n).)
The "Apply" operator (like ∀ or ∃) takes
a binary operator, a variable, a range and
a term, in which that variable is free.

Apply(Op vs set term(vs) value) <=>  ∃ RS ε relation symbol.
     ∀ x ε set. RS(x 0) = id(Op) &
		∀ 0≤i<|set|. RS( x, Succ(i) ) = Op( RS( x, i), term{set[i]\vs} ) &
		RS(x, |set|) = value.

where
	vs is a variable symbol
	sent is a term, with free variable "vs"
	RS is a new relation symbol, gensym-med up for this case,
	id(Op) is the identity for this operation -- 0 for Sum, False for OR, ...
	set[i] is the i-th member of the set, set 
		(of course, assuming the members can be ordered)
 )

NetFlow(n set) is the flow thru n from all the elements of the set, set.
NetFlow(n {} ) = 0
NetFlow(n A∪{i} ) = NetFlow(n A) + Flow(n i)

------
a more pedestrian, less general solution:

∀ n ε Junctions. ThruPut(n) = 0.

To define this, we need to first order the Junctions --
i.e. Node(i) = N-i, the i-th node, for all M Junctions in the circuit.
Now, we can state that

[ThruPut(n) = v] <=> [TP1(n, M) = v],
where
  ∀nεJunctions. TP1(n, 0) = 0  &
	    ∀ 0≤i<M. TP1(n, Succ(i)) = TP1(n, i) + Flow(n, Node(i)).

(Again, we really could replace the second "Junctions" with Adjacent(n).)
Defn of Circuit:
There is a path from a node (through other Junctions) to itself.
where 
  Path(n, m) <=> ∃v. DirFlow(n, m, v) OR
		     [∃ p. Path(n, p) & DirFlow(p, m, v)]

We can also define
  VPath(n, m) <= MAX( DirFlow(n, m),
		Max {p ε Junctions| Path(n,p) & Path(p,m)}
		    VPath(n, p) + VPath(p, m)

I.e. VPath(n, m, V) => 
	DirFlow(n, m, V) OR
	∃ pε Junctions. Path(n,p) & Path(p,m) & [V = VPath(n, p) + VPath(p, m)]

----
Electrical Circuit
  IsA:		?
  Parts:	Battery, Resistors, Connectors
  Features:	

Battery
  IsA:		?
  Voltage:	6.5V

Connectors
  unimportant, 2 ended, uni-directional, (usually), varied flow rate
	[as only one substance, this well defined]

----
Most of important parts of a circuit is 
  
Facts about circuits

Goal: Find out new facts about the Endocrine system.
Given: wealth of facts about Electrical Circuits.
Scenario: Hear that the "Endocrine system is like an Electrical Circuit",
	and deduce that ...
There is a Battery-like part -- i.e. a source.
This is the pituitary (master) gland; it is from here the basic "stuff" comes
	* Difference: electricity stuff is homogenous,
		but there are different types of hormones
There are select paths -- thru which the stuff flows.
	These paths (may) have different resistances
	Each of these paths must form a loop [def'n of circuit].
  Major problems arise in a circuit when it is
	broken, shorted, 
  Minor problems arise in a circuit when 
	the path's resistance is too high [delays, ...]
Timing issues?
VLSI
Transistors, resistors, batteries, capacitors, ...
	[each has factors, and can lead to problems]
-----

Realization (1): Really means "(Parts of) Endocrine system form a Circuit".
Hence, pull in facts re: circuit -- i.e. loops, need notion of connectivity,
so find slots which match X to X(s)
and consider transitive closure.
Consider when that is acyclic, or forms complete loops.
Then see what factors are relevant:
e.g. when there is an open loop, or blockage, or lack of connectivity, or ...

	--- Merge this in ---

SomeDevice is a "Circuit" if its parts exhibit certain behavior.
(ie Devices flow about, thru orifices, ...)

-----

Given A and B are analoguous, each satisfying a common theory.
(In general this means their behavior is similar.)
Now what?
Well, consider what else is known to be true about B --
e.g. standard types of errors, creator, ...
These may carry over to A, mutatis mutandis.

Hence, imagine starting with a program capable of diagnosing bugs in
an (analog) electrical system, and wishing to build a new system
to troubleshoot renal failure.
Begin by telling it the top level analogy:
"The renal system is like an electrical circuit, 
  (1) in that both satisfy the equations for circuits
	[i.e. there is some material flowing about, which is conserved, & ...]
  (2) in terms of interactions of components.
	[i.e. components are isomorphic, with different names]
"
Then proceed to embellish this (by accepting statements like 
"...  in that the body water is battery-like source",
"the blood-paths map to the wires", ... capacitors, resistance, ...
-----
-----

Given an algorithm for troubleshooting electrical systems
[e.g. to figure why there is no current flow here, consider whether
	the battery is dead, or if any of the wires are blocked (cut),
	or it there is a short intercepting the flow, or ...]
consider how to apply this to the task of troubleshooting the renal system
[e.g. to figure why there is no urinary output, consider whether
	there is no resovior, or if any part of the bodily water intake to
	urine is blocked (cut), or it there is a "short" intercepting the flow,
	(that is, a leak from the body, ...) or ...]

There must be a tag indicating that this diagnosis routine will work for
any circuit (that is, such is sufficient).

---
I need to develope a language/model which can take 
(1) a description of an electrical circuit, and
(2) a problem situation;
and suggest possible causes of the problem, based on facts known about 
electricity, circuits, ...

First, to describe circuits.
Need class of objects:
Batteries (source)
Components
   Resistors
   Capacitors
   Coils ...
Junctions
   Wires
   Switches
	Transistors

and some way to encode that electricity flows around the circuit, from the
battery, through the components (doing various Devices) and returns there.

   **** TALK WITH DART PEOPLE!
   **** Do they ever deal with analog stuff -- with wires, ... ?

---
Much of John's stuff is quite qualitative -- having terms like "mildly severe".
This is not present in the case of electrical circuits, where we can
explicitly tell what we had expected -- e.g. a particular voltage drop
across a ?x?, or an anticipated current at a location... 
Now, on finding that is not the case, ...
-------

	** General Rules **
[this is a general backtracking scheme]

If error at junction J,
  THEN Check
	Channels leading to J
	Predecessors of J (for this problem)

IF junction J blocked at time t
  THEN [From(J) will be excessive at time t+ε
	To(J) will be depleted at tim t+ε

-----
<<probably this rule should be written in the other way --
	reduced amount at P can cause J to be low... >>

Low amount, High amount, Wrong substance, time-delayed, ...

IF Low amount of stuff S at Junction J,
  THEN Either:
	(i) A channel to J is blocked, or
	(ii) A predecessor of J, P, is Low in S.
	[or both]

(i) expands to:
	∃ (channel C). (C leads to J) & (S is not flowing thru C "unobstructed").

(ii) expands to:
	∃ (channel C),(node N). (C leads from N to J) & (N is low (on S)).

-----
The following can cause 
	(S is not flowing thru C "unobstructed").

(a) S is leaking out of C (w/ or w/out the rest of the flow)
	[i.e. C is broken, or not "sealed"]
(b) S's flow (with or without the rest of the flow) is blocked
(c) S is diffusing, so it is not the same stuff...

The (b) case.
	S's flow (with or without the rest of the flow) is blocked,
could be caused by too high a resistance.

----
Note this will work with different substances... and so can pass messages,
as with oil spills, or endocrine system, or message-passing actors, or ...

----
ImpairedFlow( l-i ) => Low( To(l-i) ) 
[unless mitigating ...]